import ToolActionApi from "@/tool/http/tool-action.js";

let platformAction = ToolActionApi.init("function_platform")

const rule = {
	queryParams: [],
	formOnChange: (watchForm) => {
		let tempArray = []
		if (watchForm['enum_platform_type'] === 'HAI_KANG') {
			tempArray.push({
				name: "__host",
				memo: "请求主机"
			})
			tempArray.push({
				name: "__httpsTag",
				memo: "是否https",
				dictList: [{
						name: '是',
						val: 'true'
					},
					{
						name: '否',
						val: 'false'
					},
				]
			})
		}
		return tempArray;
	},
	pageConfig: {},
	metaConfig: {},
	baseField: [{
		name: "id"
	}]
}

export default async function(metadata) {
	rule.metaConfig.platform_id = {
		dictList: await platformAction.dict()
	}
	return rule;
}
